<?php

if(!defined('_HTML_NAVIGATION_')) {
define('_HTML_NAVIGATION_', 1);

function flep_html_navigation(&$data, $extra_url = ''){
  if(flep_search_count($data)){
    $total = $data['total'][0]['total'];
    $end = $total;
    $start =  $data['offset'] + 1;
    $search_arrows = '';
    $arrow_sintax = '&nbsp;<a href="?page=%s&idx=%s%s" title="%s"><img style="vertical-align: text-bottom;" src="img/arrow-%s.png"></a>';
    if($data['offset'] > 0) {
      $search_arrows .= sprintf($arrow_sintax, $_GET['page'], $data['page_idx'] - 1, $extra_url, 'Go Back', 'left');
    }
    if(($data['offset'] + 30) < $total) {
      $search_arrows .= sprintf($arrow_sintax, $_GET['page'], $data['page_idx'] + 1, $extra_url, 'Go Next', 'right');
      $end = $data['offset'] + 30;
    }
    printf("%s-%s de %s %s",$start , $end, $total, $search_arrows);
  }
}

}
?>
